package com.qkjia.day02;

public class Test06_volatile {
    public volatile int a;

    public int getA() {
        return a;
    }
    public void setA(int count) {
        this.a = this.a+count;
    }
    public static void main(String[] args) {
        Test06_volatile text = new Test06_volatile();
        new Thread(()->{
            text.getA();
        },"AA").start();


        new Thread(()->{
            text.setA(3);
        },"BB").start();
    }
}
